package com.baizhi.exceptionx;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * 运行时异常和编译时异常
 */
public class ExceptionDemo1 {
    public static void main(String[] args) throws FileNotFoundException {

        System.out.println("程序开始了");

        String str = null;

        System.out.println(str.length()); //编译时没有报错，运行时报错了，这就是运行时异常

        FileInputStream fis = new FileInputStream("./javase_exception/a.txt"); //在编译阶段就已经提示出现了异常，编译时异常



        System.out.println("程序结束了");

    }
}
